Previous Book Contents Book Index Next

Inside Macintosh: QuickDraw GX Objects /
Chapter 4 - Colors and Color-Related Objects / Colors and Color-Related Objects Reference
Color Set Functions / Creating and Manipulating Color Set Objects


GXCopyToColorSet

You can use the GXCopyToColorSet function to copy the contents of one existing color set to another, or to create a new color set and copy the contents of an existing color set into it.

gxColorSet GXCopyToColorSet(gxColorSet target, gxColorSet source);
target
A reference to the color set to copy the source color set's contents into. If you specify nil for this parameter, the function creates a new color set.
source
A reference to the color set whose contents you want to copy.
function result
A reference to the color set copy.
DESCRIPTION
The GXCopyToColorSet function copies the contents of an existing color set object to another or it creates a new color set object and copies the contents of an existing color set object to it. The function copies the color space and color values and tag list (but not the owner count) of the color set object specified by the source parameter into the color set object specified by the target parameter. It clones, but does not copy, the tag objects in the tag list.

If you specify nil for the target parameter, GXCopyToColorSet creates a new color set object and copies the source color set's properties, including the owner count and tag list, into it.

You can use the GXCopyToColorSet function to create a copy of a color set and then modify it without changing the original.

SPECIAL CONSIDERATIONS
If you specify nil for the target parameter and no error occurs, the GXCopyToColorSet function creates a color set object; you are responsible for disposing of that object when you no longer need it.

If you specify a color set object used by an onscreen view device as the target, this function posts a colorSet_access_restricted warning.

ERRORS, WARNINGS, AND NOTICES
Errors 
out_of_memory 
colorSet_is_nil 
Warnings 
colorSet_access_restricted(debugging version)
SEE ALSO
To create a new color set that is not a copy of an existing color set, use the GXNewColorSet function, described on page 4-64.

To compare two color set objects, use the GXEqualColorSet function, described in the next section.


Previous Book Contents Book Index Next

© Apple Computer, Inc.
7 JUL 1996